package mr.ali.videoapp.portal.mapper;

import mr.ali.videoapp.portal.model.OpenId;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

/**
* <p>
    *  Mapper 接口
    * </p>
*
* @author Mr-ali
* @since 2024-08-01
*/
    @Repository
    public interface OpenIdMapper extends BaseMapper<OpenId> {
        // 根据openId查询OpenId对象


    @Update("update open_id set language=#{language} where id=#{id}")
    Integer upLanguage(@Param("id") Integer id, @Param("language") Integer language);


    @Select(value = "select * from open_id where open_id=#{openId}")
        OpenId selectByOpenId(String openId);

    @Update("update open_id set status=#{status} where id=#{id}")
    Integer deleteStatus(@Param("id") Integer id, @Param("status") Integer status);


    @Update("update open_id set status=#{status},status_create=#{statusCreate} where id=#{id}")
    Integer updateStatus(@Param("id") Integer id,@Param("status") Integer status,@Param("statusCreate") Long statusCreate);

    @Update("update open_id set status=#{status},status_create=#{statusCreate} where id=#{id}")
    Integer updateStatusJia(@Param("id") Integer id,@Param("status") Integer status,@Param("statusCreate") Long statusCreate);

    @Update("update open_id set yes_money=#{yesMoney} where id=#{id}")
    Integer updateYesMoney(@Param("id") Integer id,@Param("yesMoney") Double yesMoney);

    @Update("update open_id set not_money=#{notMoney} where id=#{id}")
    Integer updateNotMoney(@Param("id") Integer id,@Param("notMoney") Double notMoney);

}

